package com.shanhy.lixp.need001.service;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 单位Service
 *
 * @author 单红宇(365384722)
 * @myblog http://blog.csdn.net/catoop/
 */
@Service
public class CompanyHtmlService {

	private static final Logger logger = LoggerFactory.getLogger(CompanyHtmlService.class);

	@Autowired
	private CompanyHtmlParser orderHtmlParser;

	/**
	 * 获取网页数据为对象集合
	 *
	 * @param pageNum
	 *            页数
	 * @return
	 * @author SHANHY
	 * @create 2016年9月3日
	 */
	public Map<String, Object> getCompanyListByHtml(int pageNum) {
		logger.info("开始获取网页数据,第{}页...", pageNum);
		long startTime = System.currentTimeMillis();
		Map<String, Object> map = orderHtmlParser.getCompanyList(Integer.toString(pageNum));
		logger.info("获取网页数据结束，耗时：{}ms", System.currentTimeMillis() - startTime);
		return map;
	}

}
